﻿<Window x:Name="window" Title="GlobalHotkeys" Height="300" Width="480" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:huddled="http://schemas.huddledmasses.org/wpf" xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" x:Class="GlobalHotkeys.DemoWindow" 
    WindowStyle="SingleBorderWindow" ><!-- The SingleBorderWindow is important for the CustomChrome behavior -->
    <i:Interaction.Behaviors>
        <huddled:SnapToBehavior SnapDistance="20,20,20,80" />
    </i:Interaction.Behaviors>
    <Grid>
      <Label HorizontalAlignment="Center" VerticalAlignment="Top" Content="{Binding Path=Title, ElementName=window, Mode=Default, FallbackValue=Window Title}" FontFamily="{DynamicResource {x:Static SystemFonts.CaptionFontFamilyKey}}" FontSize="{DynamicResource {x:Static SystemFonts.CaptionFontSizeKey}}" FontWeight="{DynamicResource {x:Static SystemFonts.CaptionFontWeightKey}}" FontStyle="{DynamicResource {x:Static SystemFonts.CaptionFontStyleKey}}" Panel.ZIndex="4">
         <!-- this label replaces the window "Caption" -->
         <Label.BitmapEffect> <OuterGlowBitmapEffect GlowColor="#FFFFFFFF"/> </Label.BitmapEffect> </Label>
      <!-- And these buttons get to show up on the caption! -->
      <StackPanel Margin="0,0,100,0" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Panel.ZIndex="5" >
         <Button x:Name="ToggleChrome" huddled:CustomChrome.HitTestable="True" BorderThickness="1,0,1,1" Padding="1,0,1,0" Width="{DynamicResource {x:Static SystemParameters.WindowCaptionButtonWidthKey}}" Height="{DynamicResource {x:Static SystemParameters.WindowCaptionButtonHeightKey}}" Focusable="False" >
            <Image Source="Artwork\AppLightning.png" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" Height="15" Width="15" />
         </Button>
         <Button x:Name="AlwaysOnTop" huddled:CustomChrome.HitTestable="True" BorderThickness="1,0,1,1" Padding="1,0,1,0" Width="{DynamicResource {x:Static SystemParameters.WindowCaptionButtonWidthKey}}" Height="{DynamicResource {x:Static SystemParameters.WindowCaptionButtonHeightKey}}" Focusable="False" >
            <Image Source="Artwork\AppPin.png" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" Height="15" Width="15" />
         </Button>
      </StackPanel>
      <!-- The "ClientConstrained" on this container means it will have it's Margins set to keep it off the borders -->
      <Grid huddled:CustomChrome.ClientConstrained="True" Grid.Row="1">
         <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
         <TextBlock Text="Drag this window near the screen edges..." TextWrapping="Wrap" Margin="0,0,0,0" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" Foreground="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
         <StatusBar Grid.Row="1" SnapsToDevicePixels="True" Margin="0,0,0,0" VerticalAlignment="Top" Height="Auto">
            <StatusBarItem Content="Running"/>
            <Separator/>
            <StatusBarItem Content="Your advertisement here!" HorizontalAlignment="Right"/>
         </StatusBar>
      </Grid>
    </Grid>
</Window>
